import yagmail
import logging

class Tools():
    #日志
    def info_log(self,filename,filemode):
        logging.basicConfig(
            filename=filename,
            filemode=filemode,
            format='%(name)s->%(filename)s->%(asctime)s->(message)s',
            level=logging.DEBUG
        )

    #邮件
    def send_eamil(self,subject,filename):
        send=yagmail.SMTP(user='1419002374@qq.com',password='pblpfajgpwcohfea',host='smtp.qq.com')
        send.send(to='1419002374@qq.com',subject=subject,attachments=filename)